import request from '@/utils/request'
const baseUrl = process.env.VUE_APP_TMS_IAM_HOST
// 获取角色列表
export function roleSearch(data) {
  return request({
    url: `${baseUrl}/api/v1/iam-role/search`,
    method: 'post',
    data: data
  })
}
// 删除角色
export function rolesDelete(ids = []) {
  return request({
    url: `${baseUrl}/api/v1/iam-role/batchDelete`,
    method: 'post',
    data: {
      ids: ids
    }
  })
}
// 添加角色
export function roleAdd(data) {
  return request({
    url: `${baseUrl}/api/v1/iam-role`,
    method: 'post',
    data: data
  })
}

// 详情角色
export function roleDetails(id) {
  return request({
    url: `${baseUrl}/api/v1/iam-role/${id}`,
    method: 'post'
  })
}

// 编辑角色
export function roleEdit(data, id) {
  return request({
    url: `${baseUrl}/api/v1/iam-role/${id}`,
    method: 'put',
    data
  })
}
// 获取角色下拉菜单
export function roleSelector(data) {
  return request({
    url: `${baseUrl}/api/v1/iam-role/selector`,
    method: 'post',
    data: data
  })
}
